package com.epam.training.concurrency.first.task2;

import java.util.Arrays;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.epam.training.concurrency.first.task3.CircularBuffer;

/**
 * 
 * Test multithreading merge sort
 * 
 * @author Bogdan
 *
 */
public class TestMergeSort {

	private TestMergeSort() {

	}

	public static void main(String[] args) {
		MultithreadMergeSort sort = new MultithreadMergeSort();

		int[] a = new int[1000];

		Random rand = new Random();

		for (int i = 0; i < a.length; i++) {
			a[i] = rand.nextInt(5000);
		}

		int[] b = new int[a.length];

		try {
			sort.sort(a, 0, a.length - 1, b, 0);
		} catch (InterruptedException e) {
			Logger.getLogger(CircularBuffer.class.getName()).log(Level.SEVERE,
					null, e);
		}

		System.out.println(Arrays.toString(a));
		System.out.println(Arrays.toString(b));

	}

}
